package com.base.thread.demo_49;

/**
 *  49Java中的阻塞队列原理与使用
 *  BlockingQueue
 * @ClassName: Main
 * @Description: 
 * @Author xuyou
 * @DateTime 2020年12月21日 上午10:16:30
 */
public class Main {
	
	public static void main(String[] args) {
		
		Shop tmall = new Tmall3();
		
		PushTarget p = new PushTarget(tmall);
		TakeTarget t = new TakeTarget(tmall);
		
		new Thread(p).start();
		new Thread(p).start();
		new Thread(p).start();
		new Thread(p).start();
		new Thread(p).start();
		new Thread(p).start();
		new Thread(p).start();
		new Thread(p).start();
		
		new Thread(t).start();
		new Thread(t).start();
		new Thread(t).start();
		new Thread(t).start();
		new Thread(t).start();
		new Thread(t).start();
		new Thread(t).start();
		new Thread(t).start();
		
		new Thread(new Runnable() {
			
			@Override
			public void run() {
				tmall.size();				
			}
		}).start();
	}
	
}
